﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace DockSample.Line
{
    class SelfRoundLine : ComplexLine
    {

        public SelfRoundLine(Point startPoint, OriginalDiagram startDiagram)
            : base(startPoint, startDiagram)
        {


            this.Init();


        }

        public SelfRoundLine(Point startPoint, OriginalDiagram startDiagram, string id)
            : base(startPoint, startDiagram, id)
        {

            this.Init();


        }

        public void Init()
        {
            Point p1 = new Point(startPoint.X - 18 - this.StartDiagram.Width, startPoint.Y);

            this.startLine = new StartLine(this.StartPoint, p1, this.StartDiagram, this.id);
            this.endLine = new EndLine(p1, this.EndPoint, this.EndDiagram, this.id);
            isComplex = true;
            this.simpleLineList.RemoveRange(0, this.simpleLineList.Count);


            Point p2 = new Point(startPoint.X - 18 - this.StartDiagram.Width, startPoint.Y - 18 - this.StartDiagram.Height);
            Point p11 = new Point(p1.X, p1.Y + 14);
            StartLine newStartLine = new StartLine(this.StartPoint, p2, this.StartDiagram, this.id);
            SimpleLine newPart = new SimpleLine(p2, p11, this.id);
            this.simpleLineList.Add(newPart);
            this.startLine = newStartLine;


            Point p3 = new Point(startPoint.X, startPoint.Y - 18 - this.StartDiagram.Height);
            StartLine newStartLine1 = new StartLine(this.StartPoint, p3, this.StartDiagram, this.id);
            SimpleLine newPart1 = new SimpleLine(p3, p2, this.id);
            this.simpleLineList.Add(newPart1);
            this.startLine = newStartLine1;

        }

        new public void Drawing(Graphics g, DummyModelForm m)
        {
            this.Init();
            base.Drawing(g, m);

        }

        private void AddTurningPoint(Point mouseDownPoint, Point mouseUpPoint) { }


    }
}
